﻿using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using AnQinFrameWorkAPI.Entity.SystemCore.Entity;

namespace AnQinFrameWorkAPI.Entity.BaseInfo.Entity;

/// <summary>
///     员工表模型
/// </summary>
[Table("Staff")]
public class StaffModel
{
    #region 字段

    /// <summary>
    ///     员工表id
    /// </summary>
    [Key]
    [MaxLength(36)]
    public Guid Id { get; set; }

    /// <summary>
    ///     员工编码
    /// </summary>
    [MaxLength(50)]
    public string Code { get; set; }

    /// <summary>
    ///     员工名称
    /// </summary>
    [MaxLength(50)]
    public string Name { get; set; }

    /// <summary>
    ///     员工头像
    /// </summary>
    [MaxLength(250)]
    public string? HeadImage { get; set; }

    /// <summary>
    ///     账号
    /// </summary>
    [MaxLength(50)]
    public string Account { get; set; }

    /// <summary>
    ///     密码
    /// </summary>
    [MaxLength(50)]
    public string Password { get; set; }

    /// <summary>
    ///     部门id
    /// </summary>
    [MaxLength(36)]
    public Guid? DepartmentId { get; set; }

    /// <summary>
    ///     创建时间
    /// </summary>
    public DateTime CreateTime { get; set; }

    #endregion

    #region 关联

    /// <summary>
    ///     部门
    /// </summary>
    public virtual DepartmentModel Department { get; set; }

    /// <summary>
    ///     员工角色列表
    /// </summary>
    public virtual ICollection<StaffRoleModel> StaffRoleList { get; set; } = new List<StaffRoleModel>();

    #endregion
}